<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<!--<input type="hidden" id="lineId" th:value="*{lineId}"/>-->
<input type="hidden" id="byqName" th:value="*{byqName}"/>
<input type="hidden" id="byqId" th:value="*{byqId}"/>
<!--<input type="hidden" id="pointId" th:value="*{pointId}"/>-->
<!--<input id="deviceIdArray" name="deviceIdArray" type="hidden">-->
     <div class="container-div">
		<div class="row">
			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-warning" onclick="exportZc()">
					<i class="fa fa-download"></i> 导出资产
				</a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">

		var prefix = ctx + "assets/ThyDetiail";

        var byqId = $("#byqId").val();		//	变压器ID
        var byqName = $("#byqName").val();		//


        $(function() {
            var options = {
                url: prefix + "/listZC?byqId="+byqId,
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove2Id",
				exportUrl: prefix + "/export",
                showSearch:false,		//是否显示检索信息
                showRefresh:false,		//是否显示刷新按钮
                showToggle:false,		//是否显示详细视图和列表视图的切换按钮
                showColumns:false,		//是否显示隐藏某列下拉框
                sortable:false,		//是否启用排序
                pagination: false,		//禁用分页插件
                modalName: "配电设备基类",
//		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '',
					visible: false
				},
				{
					field : 'deptId',
					title : '供电所',
					sortable: false
				},
				{
					field : 'byqId',
					title : '台区',
					sortable: false
				},{
					field : 'line10kv',
					title : '所属馈线',
					sortable: false
				},
				{
					field : 'jkgg',
					title : '架空线路规格',
					sortable: false
				},
				{
					field : 'jksl',
					title : '架空线路数量',
					sortable: false
				},
				{
					field : 'dlxl',
					title : '电缆线路规格',
					sortable: false
				},
				{
					field : 'dlsl',
					title : '电缆线路数量',
					sortable: false
				},{
					field : 'line380v',
					title : '380v线路长度',
					sortable: false
				},
				{
					field : 'line220v',
					title : '220v线路长度',
					sortable: false
				},{
					field : 'lineSum',
					title : '线路合计',
					sortable: false
				},
				{
					field : 'gt8',
					title : '8米杆',
					sortable: false
				},
				{
					field : 'gt10',
					title : '10米杆',
					sortable: false
				},
				{
					field : 'gt12',
					title : '12米杆',
					sortable: false
				},
				{
					field : 'gt12t',
					title : '12米特型杆',
					sortable: false
				},
				{
					field : 'gt15',
					title : '15米杆',
					sortable: false
				},
				{
					field : 'gt15t',
					title : '15米特型杆',
					sortable: false
				},
				{
					field : 'gt18',
					title : '18米杆',
					sortable: false
				},
				{
					field : 'gt18t',
					title : '18米特型杆',
					sortable: false
				},
				{
					field : 'gtSum',
					title : '杆基总和',
					sortable: false
				},
				{
					field : 'gtXz',
					title : '杆塔形状',
					sortable: false
				},
				{
					field : 'factroy',
					title : '生产厂家',
					sortable: false
				},
				{
					field : 'tyTime',
					title : '投运日期',
					sortable: false
				},
				{
					field : 'dxHb',
					title : '单相户表',
					sortable: false
				},
				{
					field : 'bxOne',
					title : '单相表箱1表位',
					sortable: false
				},
				{
					field : 'bxTwo',
					title : '2表位',
					sortable: false
				},
				{
					field : 'bxFour',
					title : '4表位',
					sortable: false
				},
				{
					field : 'bxSix',
					title : '6表位',
					sortable: false
				},
				{
					field : 'bxNine',
					title : '9表位',
					sortable: false
				},
				{
					field : 'bxTwelve',
					title : '12表位',
					sortable: false
				},
				{
					field : 'bxSum',
					title : '单相表箱合计',
					sortable: false
				},
				{
					field : 'sxHb',
					title : '三相户表',
					sortable: false
				},
				{
					field : 'sxbx',
					title : '三相表箱',
					sortable: false
				},
				{
					field : 'jzq',
					title : '集中器',
					sortable: false
				},
				{
					field : 'hgq',
					title : '互感器',
					sortable: false
				},
				{
					field : 'fzx',
					title : '分支箱',
					sortable: false
				},
				{
					field : 'pdg',
					title : '配电柜',
					sortable: false
				}]
            };
            $.table.init(options);
        });


        function exportZc() {
            var url = ctx+ "assets/exportDetiail_Excel/Assets";
            $.ajax({
                type : "POST",
                url : url,
                data : {
                    "id":byqId
                },
                error : function(request) {
                    $.modal.alertError("导出数据错误，请联系管理员！");
                },
                success : function(data) {
                    var fileName = byqName+"-资产表";
                    window.location.href = ctx + "assets/exportDetiail_Excel/expAssets?fileName=" + fileName+ "&id=" + byqId+ "&delete=" + true;
                }
            });

        }

    </script>
</body>
</html>